from utils.common import get_current_timestamp, generate_mock_image_data

class GlassesMockResponse:
    @staticmethod
    def get_detect_response():
        """
        物体检测场景响应
        返回:
            status: 接口调用状态 (success/error)
            data: {
                image: base64编码的图像数据
                intent: 用户意图，固定为"detect"
                scene_type: 场景类型 (indoor室内/outdoor室外)
                device_info: {
                    battery: 电池电量百分比(0-100)
                    storage: 存储空间使用率(0-100)
                    temperature: 设备温度(摄氏度)
                    network: 网络状态(stable稳定/unstable不稳定/disconnected断开)
                }
                timestamp: 响应时间戳(YYYY-MM-DD HH:MM:SS)
            }
        """
        return {
            "status": "success",
            "data": {
                "image": generate_mock_image_data(),
                "intent": "detect",
                "scene_type": "indoor",
                "device_info": {
                    "battery": 85,
                    "storage": 70,
                    "temperature": 37,
                    "network": "stable"
                },
                "timestamp": get_current_timestamp()
            }
        }

    @staticmethod
    def get_logistics_response():
        """
        物流识别场景响应
        返回:
            status: 接口调用状态 (success/error)
            data: {
                image: base64编码的图像数据
                intent: 用户意图，固定为"logistics"
                scan_mode: 扫描模式 (express快递单/barcode条形码)
                device_info: {
                    battery: 电池电量百分比(0-100)
                    storage: 存储空间使用率(0-100)
                    temperature: 设备温度(摄氏度)
                    network: 网络状态(stable稳定/unstable不稳定/disconnected断开)
                }
                timestamp: 响应时间戳(YYYY-MM-DD HH:MM:SS)
            }
        """
        return {
            "status": "success",
            "data": {
                "image": generate_mock_image_data(),
                "intent": "logistics",
                "scan_mode": "express",
                "device_info": {
                    "battery": 84,
                    "storage": 70,
                    "temperature": 37,
                    "network": "stable"
                },
                "timestamp": get_current_timestamp()
            }
        }

    @staticmethod
    def get_navigation_response():
        """
        导航场景响应
        返回:
            status: 接口调用状态 (success/error)
            data: {
                image: base64编码的场景图像数据
                intent: 用户意图，固定为"navigation"
                location: {
                    latitude: 当前位置纬度
                    longitude: 当前位置经度
                    accuracy: GPS精度(米)
                }
                device_info: {
                    battery: 电池电量百分比(0-100)
                    storage: 存储空间使用率(0-100)
                    temperature: 设备温度(摄氏度)
                    network: 网络状态(stable稳定/unstable不稳定/disconnected断开)
                }
                timestamp: 响应时间戳(YYYY-MM-DD HH:MM:SS)
            }
        """
        return {
            "status": "success",
            "data": {
                "image": generate_mock_image_data(),
                "intent": "navigation",
                "location": {
                    "latitude": 31.2304,    # 纬度值
                    "longitude": 121.4737,   # 经度值
                    "accuracy": 10.0         # GPS精度(米)
                },
                "device_info": {
                    "battery": 83,
                    "storage": 70,
                    "temperature": 37,
                    "network": "stable"
                },
                "timestamp": get_current_timestamp()
            }
        }

# 测试代码
if __name__ == "__main__":
    print("物体检测响应:")
    print(GlassesMockResponse.get_detect_response())
    print("\n物流识别响应:")
    print(GlassesMockResponse.get_logistics_response())
    print("\n导航响应:")
    print(GlassesMockResponse.get_navigation_response())